﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="CleanupJobSchema"
    targetNamespace="http://schemas.codeplex.com/SPCleanup/CleanupJobSchema.xsd"
    elementFormDefault="qualified"
    xmlns="http://schemas.codeplex.com/SPCleanup/CleanupJobSchema.xsd"
    xmlns:mstns="http://schemas.codeplex.com/SPCleanup/CleanupJobSchema.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:element name="CleanupJob">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="SiteDefinition" type="SiteDefinition" maxOccurs="unbounded" minOccurs="0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="SiteDefinition">
    <xs:sequence>
      <xs:element name="Site" maxOccurs="unbounded" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="List" type="List" maxOccurs="unbounded" minOccurs="0" />
          </xs:sequence>
          <xs:attribute name="enabled" type="xs:boolean" default="true" use="optional" />
          <xs:attribute name="id" type="xs:string" use="required" />
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="uri" type="xs:anyURI" use="required" />
    <xs:attribute name="id" type="xs:string" use="required" />
    <xs:attribute name="enabled" type="xs:boolean" default="true" use="optional" />
  </xs:complexType>
  <xs:complexType name="List">
    <xs:sequence>
      <xs:element name="CleanupInfo" type="CleanupInfo" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="id" type="xs:string" use="required" />
    <xs:attribute name="enabled" type="xs:boolean" default="true" use="optional" />
  </xs:complexType>
  <xs:complexType name="CleanupInfo">
    <xs:sequence>
      <xs:element name="Exception" type="CleanupItemException" maxOccurs="unbounded" minOccurs="0" nillable="true" />
    </xs:sequence>
    <xs:attributeGroup ref="Properties" />
  </xs:complexType>
  <xs:attributeGroup name="Properties">
    <xs:attribute name="timeSpan" type="xs:double" use="required" />
    <xs:attribute name="browseSubfolders" type="xs:boolean" default="true" use="optional" />
    <xs:attribute name="email" type="xs:boolean" default="false" use="optional" />
    <xs:attribute name="deleteSubfolders" type="xs:boolean" default="true" use="optional" />
  </xs:attributeGroup>
  <xs:complexType name="CleanupItemException">
    <xs:attributeGroup ref="Properties" />
    <xs:attribute name="pattern" type="xs:string" use="required" />
  </xs:complexType>

</xs:schema>
